package com.woniuxy.commons.request;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: Mr·Xiang
 * @create 2024-04-03 17:23
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResponseResult<T> {

    public static final ResponseResult OK = new ResponseResult(StateCode.SUCCESS, Message.SUCCESS);

    private Integer code;
    private String message;
    private T data;

    public ResponseResult(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public ResponseResult(ResponseResult result, T data) {
        this.code = result.getCode();
        this.message = result.getMessage();
        this.data = data;
    }
}
